#pragma once

#include "path.hpp"
#include "details.hpp"

namespace easyfs
{
    class file
    {
    public:
        file(const path& p) : _path(p) {}

        void create() { create_file(_path); }

        void remove() { easyfs::remove(_path); }

        void copy(const path& to) { easyfs::copy(_path, to); }

        void move(const path& to) { easyfs::move(_path, to); }

        bool exists() { return easyfs::exists(_path); }

        void clear() { easyfs::clear(_path); }

        size_t line() { return line_number(_path); }

        int64_type size() { return easyfs::file_size(_path); }

        time_type mtime() { return last_modify_time(_path); }

        time_type atime() { return last_access_time(_path); }

        time_type ctime() { return last_change_time(_path); }

        class path& path() { return _path; }

        class path dir() { return _path.parent_path(); }

        string_type read() { return read_file(_path); }

        void write(string_type content) { write_file(_path, content); }

    private:
        class path _path;
    };  
}
